/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YCKOKO
 * Date: 2022-10-27
 * Time: 10:36
 */
public class Test {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        try {
            myArrayList.add(1);
            myArrayList.add(2);
            myArrayList.add(3);
            myArrayList.display();
            System.out.println("========");
            myArrayList.add(3, 4);
            myArrayList.display();
            myArrayList.add(4, 6);
            myArrayList.display();
            System.out.println("========");
            System.out.println(myArrayList.contains(2));
            System.out.println(myArrayList.contains(8));
            System.out.println("========");
            System.out.println(myArrayList.get(2));
            System.out.println(myArrayList.get(5));
            myArrayList.remove(2);
            myArrayList.display();
            myArrayList.clear();
            myArrayList.display();
        }catch(isEmptyException e){
            e.printStackTrace();
        }catch(posWrongfulException e){
            e.printStackTrace();
        }
    }
}
